﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using TrainingManagement.api.Models.BusinessLogic;
using TrainingManagement.api.Models.BusinessLogic.Location;
using TrainingManagement.api.Models.BusinessObjects;

namespace TrainingManagement.api.Controllers
{
    public class LocationController : ApiController
    {
        public Location PutLocation(Location location)
        {
            return new LocationCreateOperation().Run(location);
        }

        [System.Web.Http.ActionName("Update")]
        public void PostUpdateLocation(Location location)
        {
            new LocationUpdateOperation().Run(location);
        }

        public void DeleteLocation(int locationId)
        {
            new LocationDeleteOperation().Run(locationId);
        }

        public List<Location> GetLocation(int? locationid)
        {
            return new LocationSelectOperation().Run(locationid);
        } 
    }
}
